package ${configure.mapperPackage};

import ${configure.entityPackage}.${configure.entityName};
import ${configure.queryPackage}.${configure.queryName};

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 对应表：${configure.tableName} 对应实体类：${configure.entityName}
 * <br>
 * @author ${configure.author}
 * @since ${configure.since}
 */
@Repository
public interface ${configure.mapperName} extends Mapper<${configure.entityName}> {

	// 字段
    String FIELDS = "${fieldNameList}";
    // 表名 as 别名
    String TABLE = "${configure.tableName} t";
    // mapper包名
    String PACKAGE = "${configure.mapperPackage}";

    @Results({
        @Result(column = "id", property = "id",id = true),
        @Result()//实现其他级联关系映射 无需直接删除
    })
    @Select(${ASCLL_123}"<script>SELECT ", FIELDS, " FROM ", TABLE,
            " WHERE t.valid=${ASCLL_36}${ASCLL_123}valid${ASCLL_125}",
            " ORDER BY ${ASCLL_36}${ASCLL_123}orderStr${ASCLL_125}",
            "</script>"${ASCLL_125})
	List<${configure.entityName}> pageList(${configure.queryName} qo);
}
